import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestSpring5 {
    /**
     * IOC操作Bean管理-生命周期
     */
    @Test
    public void test() {
        //ApplicationContext context = new ClassPathXmlApplicationContext("bean1.xml");
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("bean1.xml");

        Student student = context.getBean("student", Student.class);
        System.out.println("第四步：获取创建bean实例对象");
        System.out.println(student);
        //手动让bean实例销毁
        context.close();
    }


}
